#! /bin/sh

USER=admin
PASSWORD=admin

HOSTNAME=localhost
PORT=8080
CONTEXT=template/ws/resource

echo "Please type A"
read VALUEA
echo "Please type B"
read VALUEB

if [ "x$VALUEA" = "x" ]; then
    VALUEA="1"
fi

if [ "x$VALUEB" = "x" ]; then
    VALUEB="1"
fi

JSON=`cat <<EOF
	{
	"a":"$VALUEA",
	"b":"$VALUEB"
	}
EOF`

# use -u for authentication if required!
# -u "$USER:$PASSWORD" \

curl -X POST \
	-d "$JSON" \
    -H "Content-Type: application/json" \
	-H "Accept: application/json" \
	"http://$HOSTNAME:$PORT/$CONTEXT/add"
